package com.yao.system.websocket.util;

public class t1 {
    public static void main(String[] args) {

        int[] nums = {5, 2, 8, 1, 9};
        //冒泡排序
        int x=0;
        for (int i = 0; i < nums.length - 1; i++) {
            for (int j = 0; j < nums.length - 1 - i; j++) {
                if (nums[j] > nums[j + 1]) {
                    int temp = nums[j];
                    nums[j] = nums[j + 1];
                    nums[j + 1] = temp;
                }
            }
            System.out.println((++x)+":");
            for (int num : nums) {
                System.out.print(num);
            }
            System.out.println();
        }

    }
}
